-
-
Notifications
You must be signed in to change notification settings - Fork 20
Merging #20 #23 #26 #27 #28 #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging #20 #23 #26 #27 #28 #29
Conversation
This fixes the issue Thundernerd#19
removed unnecessary change
Since it only applies to SerializableInterfaces in Raw mode, it made more sense to only do it in RawReferenceDrawer instead of SerializableInterfacePropertyDrawer. Tested the same way, no apparent diff.
Would only work in UNITY_2021_1_OR_NEWER otherwise
…rawer' into Merging
Editor/Drawers/ReferenceDrawer.cs
Outdated
| UnityReferenceProperty.objectReferenceValue = DragAndDrop.objectReferences[0]; | ||
| ReferenceModeProperty.enumValueIndex = (int)ReferenceMode.Unity; | ||
| ModeValue = ReferenceMode.Unity; | ||
| PropertyValue = GetUnityObject(DragAndDrop.objectReferences[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR also fixes another bug with Drag and Dropping a GameObject that contained a Component with the right interface on it.
Previously, it would take DragAndDrop.objectReferences[0], which would be a GameObject, and set it to the UnityReferenceProperty.objectReferenceValue. This would work in the inspector, but at runtime, it would throw a InvalidCastException as it would try to cast the GameObject to the interface.
The solution was simply to get the right component instead of the GameObject.
| } | ||
| } | ||
|
|
||
| protected object PropertyValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property mirrors the behaviour of SerializableInterface.Value, but in the PropertyDrawer.
Should always check if gameObject. This will be useful later on.
|
I am not a fan of this approach. I would like all changes to be separate instead of one big chunk. This makes it easier to review the PRs and also easier to review the code history at a later stage if needed. Please make sure that all the other PRs work as intended. |
Description
Since I've done a lot of changes in a lot of the same files, merging had some side effects. This merges everything, makes sure that they work well together and adds a bit of cleanup. This could be the only PR to merge, while the others could be used to understand the process.
This PR merges all of the PR below:
#20 #23 #26 #27 #28